﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PeoplesJukebox.Core.Interfaces;
using PeoplesJukebox.Core.Enums;
using System.Runtime.Serialization;

namespace PeoplesJukebox.Core.MediaItems.Bases
{
    /// <summary>
    /// Represents a generic media item
    /// </summary>
    [KnownType(typeof(Artist))]
    [KnownType(typeof(Album))]
    [KnownType(typeof(Track))]
    [DataContract]
    public class MediaItem
    {
        /// <summary>
        /// Default constructor
        /// </summary>
        public MediaItem() { }

        /// <summary>
        /// Gets/sets the item ID
        /// </summary>
        [DataMember]
        public int Id { get; set; }

        /// <summary>
        /// Gets/sets the parent item's ID
        /// </summary>
        [DataMember]
        public int ParentId { get; set; }

        /// <summary>
        /// Gets/sets the item name
        /// </summary>
        [DataMember]
        public string Name { get; set; }

        /// <summary>
        /// Gets/sets the album name
        /// </summary>
        [DataMember]
        public string AlbumName { get; set; }

        /// <summary>
        /// Gets/sets the artist name
        /// </summary>
        [DataMember]
        public string ArtistName { get; set; }

        /// <summary>
        /// Gets/sets the item URI
        /// </summary>
        [DataMember]
        public string Uri { get; set; }

        /// <summary>
        /// Gets/sets the item type
        /// </summary>
        [DataMember]
        public virtual MediaItemType ItemType { get; set; }

        /// <summary>
        /// Gets/sets the item name, normalized for searching
        /// </summary>
        public string SearchName { get; set; }

        /// <summary>
        /// Gets/sets the owning catalogue
        /// </summary>
        public IMediaCatalogue Catalogue { get; set; }
    }
}